home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet multimedia / Muzyka / Edytory sampli (probek dzwieku) / ZynAddSubFX_2.2.0 / Setup_ZynAddSubFX-2.2.0.exe / source code / Input / MidiIn.C < prev    next >
C/C++ Source or Header  |  2005-03-14  |  2KB  |  74 lines

  1. /*
  2.   ZynAddSubFX - a software synthesizer
  3.  
  4.   MidiIn.C - This class is inherited by all the Midi input classes
  5.   Copyright (C) 2002-2005 Nasca Octavian Paul
  6.   Author: Nasca Octavian Paul
  7.  
  8.   This program is free software; you can redistribute it and/or modify
  9.   it under the terms of version 2 of the GNU General Public License 
  10.   as published by the Free Software Foundation.
  11.  
  12.   This program is distributed in the hope that it will be useful,
  13.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.   GNU General Public License (version 2) for more details.
  16.  
  17.   You should have received a copy of the GNU General Public License (version 2)
  18.   along with this program; if not, write to the Free Software Foundation,
  19.   Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  20.  
  21. */
  22.  
  23. #include "../globals.h"
  24. #include "MidiIn.h"
  25.  
  26. int MidiIn::getcontroller(unsigned char b){
  27.     int ctl=C_NULL;
  28.     switch (b){
  29.         case 1:ctl=C_modwheel;//Modulation Wheel
  30.         break;
  31.         case 7:ctl=C_volume;//Volume
  32.             break;
  33.         case 10:ctl=C_panning;//Panning
  34.         break;
  35.         case 11:ctl=C_expression;//Expression
  36.         break;
  37.         case 64:ctl=C_sustain;//Sustain pedal
  38.             break;
  39.         case 65:ctl=C_portamento;//Portamento
  40.             break;
  41.         case 71:ctl=C_filterq;//Filter Q (Sound Timbre)
  42.         break;
  43.         case 74:ctl=C_filtercutoff;//Filter Cutoff (Brightness)
  44.             break;
  45.         case 75:ctl=C_bandwidth;//BandWidth
  46.             break;
  47.         case 76:ctl=C_fmamp;//FM amplitude
  48.             break;
  49.         case 77:ctl=C_resonance_center;//Resonance Center Frequency
  50.             break;
  51.         case 78:ctl=C_resonance_bandwidth;//Resonance Bandwith
  52.             break;
  53.         case 120:ctl=C_allsoundsoff;//All Sounds OFF
  54.             break;
  55.         case 121:ctl=C_resetallcontrollers;//Reset All Controllers
  56.             break;
  57.         case 123:ctl=C_allnotesoff;//All Notes OFF
  58.             break;
  59.         //RPN and NRPN
  60.         case 0x06:ctl=C_dataentryhi;//Data Entry (Coarse)
  61.              break;
  62.         case 0x26:ctl=C_dataentrylo;//Data Entry (Fine)
  63.              break;
  64.         case 99:ctl=C_nrpnhi;//NRPN (Coarse)
  65.              break;
  66.         case 98:ctl=C_nrpnlo;//NRPN (Fine)
  67.              break;
  68.         default:ctl=C_NULL;//unknown controller
  69.         //fprintf(stderr,"Controller=%d , par=%d\n",midievent->data.control.param,cmdparams[1]);
  70.         break;
  71.     };
  72.     return(ctl);
  73. };
  74.